﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace JumpNFight.Simulation
{
    class TileHitTest
    {
        /// <summary>
        /// Defines the various hit test condition for the player 
        /// </summary>
        public enum TouchingSide : int
        {
            Top = 0,
            Right = 1,
            Bottom = 2,
            Left = 3
        }
        
        public int Coordinate
        {
            get;
            private set;
        }

        public Vector2 TileAddress
        {
            get;
            private set;
        }

        public Vector2 HitPosition
        {
            get;
            private set;
        }

        public TileHitTest(TouchingSide side, int x, int y, Vector2 hit)
        {
            TileAddress = new Vector2(x, y);
            HitPosition = hit;
            switch(side)
            {
                case TouchingSide.Top:
                    Coordinate = y;
                    break;
                case TouchingSide.Bottom:
                    Coordinate = y;
                    break;
                case TouchingSide.Right:
                    Coordinate = x;
                    break;
                case TouchingSide.Left:
                    Coordinate = x;
                    break;
            }
        }
    }
}
